package cn.kxm.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kxm.dao.StorageInfoMapper;
import cn.kxm.pojo.Storageinfo;
import cn.kxm.service.StorageInfoService;
@Service
public class StorageInfoServiceImpl implements StorageInfoService{
    @Autowired
	private StorageInfoMapper infoMapper;
	
	@Override
	public int addStorageInfoByInfow(Storageinfo info) {
		return infoMapper.addStorageInfoByInfow(info);
	}

	@Override
	public int updateStorageInfoByPartCode(Storageinfo info) {
		return infoMapper.updateStorageInfoByPartCode(info);
	}

	@Override
	public Storageinfo getStorageinfoByPartCode(String partCode) {
		return infoMapper.geStorageinfoByPartCode(partCode);
	}

	@Override
	public List<Map<String, Object>> getStorageInfoListByCode(String partNo,String currPartNo,String partName,Integer partTypeId,
            Integer instroageStatus,Integer page,Integer size) {
		Integer currPage=(page-1)*size;
		return infoMapper.getStorageInfoListByCode(partNo, currPartNo, partName, partTypeId, instroageStatus, currPage, size);
	}

	@Override
	public int getStorageInfoListByCodeCount(String partNo, String currPartNo,
			String partName, Integer partTypeId, Integer instroageStatus) {
		return infoMapper.getStorageInfoListByCodeCount(partNo, currPartNo, partName, partTypeId, instroageStatus);
	}

}
